// 文章分类
const express = require("express");

const expressJoi = require("@escook/express-joi");
const {
  artCateSchema,
  deleteArtCateByIdSchema,
  getArtCateByIdschema,
  updateCateSchema,
} = require("../schema/artcate");

const artCateHandler = require("../handler/artcate");
const router = express.Router();

router.get("/cates", artCateHandler.getArtCates);
router.post("/addcates", expressJoi(artCateSchema), artCateHandler.addArtCates);
router.get(
  "/deletecate/:id",
  expressJoi(deleteArtCateByIdSchema),
  artCateHandler.deleteArtCateById
);
router.get(
  "/cates/:id",
  expressJoi(getArtCateByIdschema),
  artCateHandler.getArtCateById
);
router.post(
  "/updatecate",
  expressJoi(updateCateSchema),
  artCateHandler.updateCate
);
module.exports = router;
